﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AnaxibiaStudios.Smug;

namespace SmugTest
{
  [TestClass]
  public class NonPublicTest
  {
    [TestMethod]
    public void ProtectedAccessTest()
    {
      var cat = Create.Proxy<Cat>();
#if DETOUR_ENABLED
      bool detour = false;
      Prepare.Action(cat, "ProtectedMethod").ReplaceWith(() => detour = true);

      cat.CallProtectedMethod();

      Assert.IsTrue(detour);
#endif
    }
  }
}
